package com.cal.utms.action.payment;

import com.cal.utms.dto.payment.PlacementSheetDto;
import com.cal.utms.model.payment.PlacementSheetModel;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class PlacementsheetAction extends ActionSupport implements ModelDriven<PlacementSheetDto> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private PlacementSheetDto placementSheetDto = new PlacementSheetDto();

	private String transactions;
	private int plasementsheetid;

	private String seldate;
	private int fundid;

	PlacementSheetModel model = new PlacementSheetModel();

	public String savePlacementSheet() {
		model.savePalcementsheet(transactions, placementSheetDto);
		return Action.SUCCESS;
	}

	public String updatePlacement() {
		model.updatePalcementsheet(transactions, placementSheetDto, plasementsheetid);
		return Action.SUCCESS;
	}

	public String getPlacementByFund() {
		placementSheetDto.setPlacementSheetDtos(model.getPlacementByFund(seldate, fundid));
		return Action.SUCCESS;
	}

	public String confirmPlacementSheet() {
		model.confirmPlacement(plasementsheetid, placementSheetDto);
		return Action.SUCCESS;
	}

	public String rejectPlacementSheet() {
		model.rejectPlacement(plasementsheetid, placementSheetDto);
		return Action.SUCCESS;
	}

	@Override
	public PlacementSheetDto getModel() {
		return placementSheetDto;
	}

	public PlacementSheetDto getPlacementSheetDto() {
		return placementSheetDto;
	}

	public void setPlacementSheetDto(PlacementSheetDto placementSheetDto) {
		this.placementSheetDto = placementSheetDto;
	}

	public String getTransactions() {
		return transactions;
	}

	public void setTransactions(String transactions) {
		this.transactions = transactions;
	}

	public int getPlasementsheetid() {
		return plasementsheetid;
	}

	public void setPlasementsheetid(int plasementsheetid) {
		this.plasementsheetid = plasementsheetid;
	}

	public int getFundid() {
		return fundid;
	}

	public void setFundid(int fundid) {
		this.fundid = fundid;
	}

	public String getSeldate() {
		return seldate;
	}

	public void setSeldate(String seldate) {
		this.seldate = seldate;
	}

}
